Conditional Statements
Very often when you write code, you want to perform different actions for different decisions. You can use conditional statements in your code to do this.
In JavaScript we have three conditional statements:
- if statement - use this statement if you want to execute a set of code when a condition is true
- if...else statement - use this statement if you want to select one of two sets of lines to execute
- switch statement - use this statement if you want to select one of many sets of lines to execute
#Title: Conditional Statements
#Element: 171: Conditional Statements